package felix.things.router.mqtt.server.common.message;

import java.util.List;

/**
 * PUBLISH重发消息存储服务接口, 当QoS=1和QoS=2时存在该重发机制
 *
 * @author Felix
 * @date 2019/8/21
 */
public interface IDupPublishMessageStoreService {

    /**
     * 存储消息
     *
     * @param clientId
     * @param dupPublishMessageStore
     */
    void put(String clientId, DupPublishMessageStore dupPublishMessageStore);

    /**
     * 获取消息集合
     *
     * @param clientId
     * @return
     */
    List<DupPublishMessageStore> get(String clientId);

    /**
     * 删除消息
     *
     * @param clientId
     * @param messageId
     */
    void remove(String clientId, int messageId);

    /**
     * 删除消息
     *
     * @param clientId
     */
    void removeByClient(String clientId);

}
